#!/bin/bash

#echo "请输入你的名字："
#read name
#name=$1
#channel=$2
echo "你好，$name,欢迎来到$channel!"
number=`shuf -i 1-10 -n 1`
echo $number
#while [[ $guess -ne $number ]]
while true
do
echo "请输入一个1-10之间的数字"
read guess
if [[ $guess -eq $number ]];then
	echo "恭喜你猜对了！是否希望继续？(y/n):"
	read choice
	if [[ $choice = "y" ]] || [[ $choice = "Y" ]];then
		number=$((RANDOM % 10 +1))
		echo $number
		continue
	else
	break
	fi
elif [[ $guess -lt $number ]];then
	echo "猜小了"
else
	echo "猜大了"
fi
done
